import React from "react";
import {Modal, Tabs} from "antd";
import PhoneLoginForm from "./PhoneLoginForm";

type LoginModalProps = {
    showLoginModal: boolean;
    onClose: () => void;
}

const LoginModal: React.FC<LoginModalProps> = ({showLoginModal,onClose}) => {
    return (
        <>
            <Modal title="用户登陆" width={500} height={500} footer={null} open={showLoginModal}
                   onCancel={()=>{onClose()}}
                   destroyOnClose={true}>
                <Tabs centered={true} defaultActiveKey="1"
                      items={[
                          {
                              key: "1",
                              label:"验证码登陆",
                              children:(<PhoneLoginForm onFinish={()=>{
                                  onClose();
                              }}/>)
                          },
                          {
                              key: "2",
                              label:"微信扫码登陆",
                              children:(<PhoneLoginForm onFinish={()=>{
                                  onClose();
                              }}/>)
                          }
                      ]}>
                </Tabs>
            </Modal>
        </>
    );
};
export default LoginModal;